package com.hnluchuan.staff.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.hnluchuan.core.model.BaseModel;

import javax.persistence.ManyToOne;
import com.hnluchuan.staff.model.User;
import java.util.Date;
import javax.persistence.JoinColumn;
import javax.persistence.FetchType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 部门
 */
@Entity
@Table(name = "department") 
public class Department extends BaseModel {
	private static final long serialVersionUID = 1L;
	
	public Department() {
	}
	
	public Department(Long id) {
		this.id = id;
	}
	
	/**
	 * id
	 */
	@Id
	@GeneratedValue
	@Column(name = "id")
	private Long id;
	/**
	 * 部门名
	 */
	@Column(name = "name")    		
	private String name;
	/**
	 * creator
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	private User creator;
	/**
	 * createTime
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@Column(name = "createTime")
	private Date createTime;
	/**
	 * updator
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updator")
	private User updator;
	/**
	 * updateTime
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@Column(name = "updateTime")
	private Date updateTime;
	// fields end
	
	/** id */
	public Long getId() {
    	return id;
    }
    /** id */
    public void setId(Long id) {
    	this.id = id;
    }
	/** 部门名 */
	public String getName() {
    	return name;
    }
    /** 部门名 */
    public void setName(String name) {
    	this.name = name;
    }
	/** creator */
	public User getCreator() {
    	return creator;
    }
    /** creator */
    public void setCreator(User creator) {
    	this.creator = creator;
    }
	/** createTime */
	public Date getCreateTime() {
    	return createTime;
    }
    /** createTime */
    public void setCreateTime(Date createTime) {
    	this.createTime = createTime;
    }
	/** updator */
	public User getUpdator() {
    	return updator;
    }
    /** updator */
    public void setUpdator(User updator) {
    	this.updator = updator;
    }
	/** updateTime */
	public Date getUpdateTime() {
    	return updateTime;
    }
    /** updateTime */
    public void setUpdateTime(Date updateTime) {
    	this.updateTime = updateTime;
    }
	
}
